package com.cpkso.buss.backend.trade.dao;

import java.util.Date;
import java.util.List;

import org.springframework.data.repository.PagingAndSortingRepository;

import com.cpkso.buss.backend.trade.domain.TbBuyerOrder;

/**
 * @author wrzhxy@qq.com
 * @date 2018年4月8日
 */
public interface TbBuyerOrderDao extends PagingAndSortingRepository<TbBuyerOrder, Long> {

	/**
	 * 按用户id 和时间查询订单
	 * @param userId
	 * @param beginTime
	 * @param endTime
	 * @return
	 */
	List<TbBuyerOrder> findByUserIdAndOrderTimeBetween(Long userId, Date beginTime, Date endTime);
	
	TbBuyerOrder findOneByOrderId(String orderId);

	List<TbBuyerOrder> findByOrderTimeBetweenAndOrderIdNotIn(Date orderStartTime, Date orderEndTime, String[] array);
	
}
